#/bin/bash

file_prefixes="1kB 10kB 100kB 1MB 10MB 100MB"
key_sizes="128 192 256"
mkdir -p results/aes

for prefix in $file_prefixes
do
	for key_size in $key_sizes
	do
		echo "Threads,Runtime" > results/aes/aes${key_size}_encrypt_${prefix}_results.csv
		./aesencrypt ${prefix}test key_${key_size} >> results/aes/aes${key_size}_encrypt_${prefix}_results.csv
		for threads in {2..32}
		do
			echo "Running aes"${key_size}" encryption test on "${prefix}" with "${threads}" threads."
			./aesencrypt_openmp ${prefix}test key_${key_size} ${threads} >> results/aes/aes${key_size}_encrypt_${prefix}_results.csv
		done
		
		echo "Threads,Runtime" > results/aes/aes${key_size}_decrypt_${prefix}_results.csv
		./aesdecrypt ${prefix}test.aes key_${key_size} >> results/aes/aes${key_size}_decrypt_${prefix}_results.csv
		for threads in {2..32}
		do
			echo "Running aes"${key_size}" decryption test on "${prefix}" with "${threads}" threads."
			./aesdecrypt_openmp ${prefix}test.aes key_${key_size} ${threads} >> results/aes/aes${key_size}_decrypt_${prefix}_results.csv
		done
		rm ${prefix}test.*
	done
done
